<?php
  require_once 'DB.php';
  include_once("./libraries/db.inc.php");
  include_once("./libraries/authentication.inc.php");
  include_once("./queries/jobQueue.inc.php");
  include_once("./libraries/util.inc.php");
  include_once("./libraries/displayUtils.inc.php");
  

  session_start();
  sessionAuthenticate("login.php");

  $cid = $_GET["cid"];  
  $pid = $_GET["pid"];
  $schedd = $_GET["schedd"];

  setUpDisplay("Job in Queue Info");

  $connection=DB::connect($dsn, $options);
  if (DB::isError($connection)) {
    trigger_error($connection->getMessage(), E_USER_ERROR);
  }
  
  


  echo "<font size=5><center><b>Complete Class Ad</b></center></font><br />\n";
  echo "<font size=5><center><b>for job: '{$schedd}'.{$cid}.{$pid}.</b></center></font><br />\n"; 
  printLink("./index.php", "Take me back to the main page!");
  echo "\n";
  if ($_SESSION["administrator"] === true) {
    echo "<br /><p>\n";
    printLink("./adminIndex.php", "Take me back to the Admin screen!");
  }
  echo "<br /><br /><b>Here is classad info:</b><br />\n";
  echo "<table><tr><th>Proc Ad Info</th><th>Cluster Ad Info</th></tr><tr><td valign=top>\n";

  echo "<table><tr><td><b>Proc h</b></td></tr><tr><td valign=top>\n";
  $dataIndex="procInfo";
  $rs = single_proc_horizontal_query($connection, $dataIndex, $schedd, $cid, $pid);
  $rs->printRecordAsVertical(1);

  echo "</td></tr><tr><td><b>Proc v</b></td></tr><tr><td valign=top>\n";
  $dataIndex="procInfo2";
  $rs = single_proc_vertical_query($connection, $dataIndex, $schedd, $cid, $pid);

  $rs->printTable();
  //echo "In progress...\n";
  echo "</td></tr></table><td valign=top>\n";
  $dataIndex="procInfo3";
  $rs = single_cluster_vertical_query($connection, $dataIndex, $schedd, $cid);

  $rs->printTable();
  echo "</td></tr></table>";

  cdbFinishPage();
  $connection->disconnect();

?>
